GATE Exam  >  GATE Questions  >  Consider the follwing C Program.#include<s... Start Learning for Free
Consider the follwing  C Program.
#include<stdio.h>
void mystery(int*ptra,int*ptrb){
int *temp;
temp =ptrb;
ptrb =ptra;
ptra =temp;
}
int main(){
int a=2016,b=0,c=4,d=42;
mystery(&a, &b);
if (a<c)
mystery(&c, &a);
mystery(&a, &d);
printf("%d", a);
}
The output of the program is _____________ .
  • a)
    2016.0 : 2016.0
  • b)
    2016.0 : 2015.0
  • c)
    2015.0  : 2016.0
  • d)
    2015.0 : 2015.0
Correct answer is '2016'. Can you explain this answer?
Verified Answer
Consider the follwing C Program.#include<stdio.h>void mystery(in...
Whatever modifications are performed in mystery ( ) function, those modifications are not reflected
in main ( ) function so it will print 2016.
View all questions of this test
Explore Courses for GATE exam
Consider the follwing C Program.#include<stdio.h>void mystery(int*ptra,int*ptrb){int *temp;temp =ptrb;ptrb =ptra;ptra =temp;}int main(){int a=2016,b=0,c=4,d=42;mystery(&a, &b);if (a<c)mystery(&c, &a);mystery(&a, &d);printf("%d", a);}The output of the program is _____________ .a)2016.0 : 2016.0b)2016.0 : 2015.0c)2015.0 : 2016.0d)2015.0 : 2015.0Correct answer is '2016'. Can you explain this answer?
Question Description
Consider the follwing C Program.#include<stdio.h>void mystery(int*ptra,int*ptrb){int *temp;temp =ptrb;ptrb =ptra;ptra =temp;}int main(){int a=2016,b=0,c=4,d=42;mystery(&a, &b);if (a<c)mystery(&c, &a);mystery(&a, &d);printf("%d", a);}The output of the program is _____________ .a)2016.0 : 2016.0b)2016.0 : 2015.0c)2015.0 : 2016.0d)2015.0 : 2015.0Correct answer is '2016'. Can you explain this answer? for GATE 2024 is part of GATE preparation. The Question and answers have been prepared according to the GATE exam syllabus. Information about Consider the follwing C Program.#include<stdio.h>void mystery(int*ptra,int*ptrb){int *temp;temp =ptrb;ptrb =ptra;ptra =temp;}int main(){int a=2016,b=0,c=4,d=42;mystery(&a, &b);if (a<c)mystery(&c, &a);mystery(&a, &d);printf("%d", a);}The output of the program is _____________ .a)2016.0 : 2016.0b)2016.0 : 2015.0c)2015.0 : 2016.0d)2015.0 : 2015.0Correct answer is '2016'. Can you explain this answer? covers all topics & solutions for GATE 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Consider the follwing C Program.#include<stdio.h>void mystery(int*ptra,int*ptrb){int *temp;temp =ptrb;ptrb =ptra;ptra =temp;}int main(){int a=2016,b=0,c=4,d=42;mystery(&a, &b);if (a<c)mystery(&c, &a);mystery(&a, &d);printf("%d", a);}The output of the program is _____________ .a)2016.0 : 2016.0b)2016.0 : 2015.0c)2015.0 : 2016.0d)2015.0 : 2015.0Correct answer is '2016'. Can you explain this answer?.
Solutions for Consider the follwing C Program.#include<stdio.h>void mystery(int*ptra,int*ptrb){int *temp;temp =ptrb;ptrb =ptra;ptra =temp;}int main(){int a=2016,b=0,c=4,d=42;mystery(&a, &b);if (a<c)mystery(&c, &a);mystery(&a, &d);printf("%d", a);}The output of the program is _____________ .a)2016.0 : 2016.0b)2016.0 : 2015.0c)2015.0 : 2016.0d)2015.0 : 2015.0Correct answer is '2016'. Can you explain this answer? in English & in Hindi are available as part of our courses for GATE. Download more important topics, notes, lectures and mock test series for GATE Exam by signing up for free.
Here you can find the meaning of Consider the follwing C Program.#include<stdio.h>void mystery(int*ptra,int*ptrb){int *temp;temp =ptrb;ptrb =ptra;ptra =temp;}int main(){int a=2016,b=0,c=4,d=42;mystery(&a, &b);if (a<c)mystery(&c, &a);mystery(&a, &d);printf("%d", a);}The output of the program is _____________ .a)2016.0 : 2016.0b)2016.0 : 2015.0c)2015.0 : 2016.0d)2015.0 : 2015.0Correct answer is '2016'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Consider the follwing C Program.#include<stdio.h>void mystery(int*ptra,int*ptrb){int *temp;temp =ptrb;ptrb =ptra;ptra =temp;}int main(){int a=2016,b=0,c=4,d=42;mystery(&a, &b);if (a<c)mystery(&c, &a);mystery(&a, &d);printf("%d", a);}The output of the program is _____________ .a)2016.0 : 2016.0b)2016.0 : 2015.0c)2015.0 : 2016.0d)2015.0 : 2015.0Correct answer is '2016'. Can you explain this answer?, a detailed solution for Consider the follwing C Program.#include<stdio.h>void mystery(int*ptra,int*ptrb){int *temp;temp =ptrb;ptrb =ptra;ptra =temp;}int main(){int a=2016,b=0,c=4,d=42;mystery(&a, &b);if (a<c)mystery(&c, &a);mystery(&a, &d);printf("%d", a);}The output of the program is _____________ .a)2016.0 : 2016.0b)2016.0 : 2015.0c)2015.0 : 2016.0d)2015.0 : 2015.0Correct answer is '2016'. Can you explain this answer? has been provided alongside types of Consider the follwing C Program.#include<stdio.h>void mystery(int*ptra,int*ptrb){int *temp;temp =ptrb;ptrb =ptra;ptra =temp;}int main(){int a=2016,b=0,c=4,d=42;mystery(&a, &b);if (a<c)mystery(&c, &a);mystery(&a, &d);printf("%d", a);}The output of the program is _____________ .a)2016.0 : 2016.0b)2016.0 : 2015.0c)2015.0 : 2016.0d)2015.0 : 2015.0Correct answer is '2016'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Consider the follwing C Program.#include<stdio.h>void mystery(int*ptra,int*ptrb){int *temp;temp =ptrb;ptrb =ptra;ptra =temp;}int main(){int a=2016,b=0,c=4,d=42;mystery(&a, &b);if (a<c)mystery(&c, &a);mystery(&a, &d);printf("%d", a);}The output of the program is _____________ .a)2016.0 : 2016.0b)2016.0 : 2015.0c)2015.0 : 2016.0d)2015.0 : 2015.0Correct answer is '2016'. Can you explain this answer? tests, examples and also practice GATE tests.
Explore Courses for GATE exam
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev